/*
 *  HarmonicSystem.h
 *  SoundController0002
 *
 *  Created by jiro on 11/06/12.
 *  Copyright 2011 jiro music. All rights reserved.
 *
 */

#pragma once

namespace WellTemperamentHarmonicSystem12 {}
namespace hs = WellTemperamentHarmonicSystem12;

#include "../../sc/SoundController.h"
#include "ChordList.h"
#include "HarmonicSound.h"
#include "Sound.h"
#include "SoundList.h"
#include "Howl.h"
#include "HowlSet.h"

#include <string>

namespace sc
{
namespace hs
{
//	class ChordList;

	class WellTemperamentHarmonicSystem12
	{
	public:
	
		enum IntegerConstants {

			LowestFrequency = 20,

			HighestFrequency = 20000,

			HarmonicsCountMax = 16,

		};

		static const double HowlFrequencyMax = 40.0;	//	1.0 / 40.0 = 0.025 sec
//		static const double HowlFrequencyMax = 16.0;

	private:

		static ChordList* twoNoteChords;

		static ChordList* threeNoteChords;

	public:

		static void CreateChords( Sound::WaveType type );

		static void DisposeChords();

		static Chord CreateChordFromMidiNumber( Sound::WaveType type, const std::vector< Note::MidiNumber >& midiNumbers );

		static std::vector< const sc::SoundElement32* > SoundToSoundElements( const ::sc::hs::Sound& sound, double duration );

		static std::vector< const sc::SoundElement32* > SoundListToSoundElements( const ::sc::hs::SoundList& sounds, double duration );

	private:

		static ChordList* GetChords( int noteCount );

	};

	typedef WellTemperamentHarmonicSystem12 HarmonicSystem;

}
}
